/**
 * Created by jihb on 5/2/16.
 */
Ext.define('JYnovel.view.novel.NovelCategoryForm',{
    extend:'Ext.form.Panel',
    layout:'anchor',
    defaults:{
        anchor:'100%',
        padding:5
    },
    initComponent:function () {
        Ext.applyIf(this,{
           items:[{
               xtype:'textfield',
               fieldLabel:'名称',
               labelWidth:60,
               labelAlign:'right',
               allowBlank:false,
               maxLength:50,
               maxLengthText:'最多50个字符',
               name:'name'
           },{
               xtype:'hiddenfield',
               name:'id'
           },{
               xtype:'hiddenfield',
               name:'level'
           },{
               xtype:'hiddenfield',
               name:'leaf'
           }],
            buttons:[{
                text:'确定',
                formBind:true,
                name:'novelCategoryOkBtn'
            }]
        });
        this.callParent(arguments);
    },
    showFormWin:function (title,id) {
        Ext.create('Ext.window.Window',{
            modal:true,
            width:300,
            height:150,
            layout:'fit',
            items:this
        }).show();

    }
});